<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <META HTTP-EQUIV="pragma" CONTENT="no-cache">
    <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
    <META HTTP-EQUIV="expires" CONTENT="0">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="../../css/public.css" media="all" />
</head>

<body class="childrenBody">
    <form class="layui-form">
        <table id="listTable1" lay-filter="list"></table>
    </form>
    <script type="text/javascript" src="../../layui/layui.js"></script>
    <script>
        layui.config({
            base: "../../js/"
        }).extend({
            "ajaxUrl": "ajax_config"
        });
        layui.use(['form', 'layer', 'laydate', 'table', 'laytpl', 'ajaxUrl'], function () {
            var form = layui.form,
                layer = parent.layer === undefined ? layui.layer : top.layer,
                $ = layui.jquery,
                laytpl = layui.laytpl,
                table = layui.table;
            var ajaxArr = layui.ajaxUrl;

            //获取url中的参数
            function getUrlParam(name) {

                var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
                var r = window.location.search.substr(1).match(reg); //匹配目标参数
                if (r != null) return unescape(r[2]);
                return null; //返回参数值
            }
            var pageId = getUrlParam('id');

            var ajaxUrl = ajaxArr.registerStatistics

            setTimeout(function () {
                //列表
                var tableIns1 = table.render({
                    elem: '#listTable1',
                    url: ajaxUrl,
                    cellMinWidth: 95,
                    page: true,
                    height: "full-125",
                    limit: 10,
                    limits: [10, 15, 20, 25],
                    id: "listTable1",
                    response: {
                        statusCode: 200 //成功的状态码，默认：200
                    },
                    cols: [
                        [
                            {
                                field: 'id',
                                title: 'ID',
                                width: 50,
                                align: "center"
                            },
                            {
                                field: 'count',
                                title: '注册数量',
                                minWidth: 150,
                                align: "center"
                            },
                            {
                                field: 'date',
                                title: '日期',
                                width: 200,
                                align: "center"
                            }
                        ]
                    ],
                    done: function (res, curr, count) {
                        // console.log(res);
                    }
                });
            }, 100)
        });

    </script>
</body>

</html>
